/* Check JER_Bitmatrix_Encode(). */
#include <stdio.h>
#include "jerasure.h"
#include "reed_sol.h"

int main( int argc, char** argv )
{
	int *old_matrix;
	int *old_matrix2;
	int *old_matrix3;
	int *inverse_matrix;
	int i, j;
	int m = atoi( argv[1] );
	int k = atoi( argv[2] );
	int w = atoi( argv[3] );
	int size;
	unsigned char* buffer;
	unsigned char** data_ptrs;
	unsigned char** coding_ptrs;

	srand48(m);
	old_matrix = (int*) malloc( sizeof(int) * k*w*m*w );
	old_matrix2 = (int*) malloc( sizeof(int) * k*w*m*w );

	i = 1 << w;
	for( j = 0; j < m*w * k*w; j++ )
	{
		old_matrix[j] = lrand48() % i;
		old_matrix2[j] = lrand48() % i;
	}

	old_matrix3 = jerasure_matrix_multiply( old_matrix, old_matrix2, m, k, 
											k, m, w );

	if( old_matrix3 != NULL )
		jerasure_print_matrix( old_matrix3, m, m, w );

	return 0;
}
